<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%
    String ctx = request.getContextPath();
    request.setAttribute("ctx", ctx);
%>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title>Bootstrap</title>
    <link rel="stylesheet" href="${ctx}/bootstrap/bootstrap.css">
    <link href="${ctx}/summernote-0.8.18/summernote.css" rel="stylesheet">
</head>
<body>
<div class="container">
    <div class="row clearfix">
        <div class="col-md-12 column">
            <div class="row">
                <c:forEach items="${pageInfo.list}" var="var">
                <div class="col-md-3" >
                    <div class="thumbnail" style="height: 520px">
                        <img alt="300x200" src="${var.picture}" style="width: 250px;height: 250px"/>
                        <div class="caption">
                            <h3>
                               ${var.title}
                            </h3>
                            <p>
                                    ${fn:length(var.content)>20?fn:substring(var.content,0,20):var.content}...
                            </p>
                            <p>
                                分类：${var.category.name} 频道： ${var.channel.name}
                            </p>
                        </div>
                    </div>
                </div>
                </c:forEach>
            </div>
        </div>
    </div>
</div>
<div class="container">
    <div class="row clearfix">
        <div class="col-md-12 column">
            <ul class="pagination">
                <li>
                    <a href="##" onclick="fenye(1)">首页</a>
                </li>
                <li>
                    <a href="##" onclick="fenye(${pageInfo.prePage})">Prev</a>
                </li>
                <li>
                    <a href="##" onclick="fenye(${pageInfo.nextPage})">Next</a>
                </li>
                <li>
                    <a href="##" onclick="fenye(${pageInfo.pages})">尾页</a>
                </li>

            </ul>
        </div>
    </div>
</div>
<textarea id="content"></textarea>
<script src="${ctx}/bootstrap/jquery-1.9.1.min.js"></script>
<script src="${ctx}/bootstrap/bootstrap.js"></script>
<script src="${ctx}/summernote-0.8.18/summernote.js"></script>
<script type="text/javascript">
    $("#content").summernote();
   /* $(document).ready(function(){
        $("#content").summernote({
            placeholder:'博客内容',
            height:300
        });
    });*/
    function fenye(pageNum) {
        location.href="/portal/index?pageNum="+pageNum;
    }
</script>
</body>
</html>